package cn.yeziji.forum.basic.file;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * web 上传文件的信息对象
 *
 * @author gzkemays
 * @since 10/27/2022 4:37 PM
 */
@Data
@NoArgsConstructor
public class WebUploaderFileInfo implements Serializable {
  String md5;
  String filename;
  String username;
  String rootPath;
  Long sizeByte;
  Integer chunks;
  Integer chunk;
  String desc;

  public WebUploaderFileInfo(WebUploader.ChuckEntity entity) {
    md5 = entity.getUploaderMd5();
    filename = entity.getOriginalFilename();
    username = entity.getUsername();
    rootPath = entity.getPath();
    sizeByte = entity.getSize();
    chunks = entity.getChunks();
    chunk = entity.getChunk();
    desc = entity.getDesc();
  }
}
